<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Batches</title>
<script language="Javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="js/paging.js"></script>

<script language="JavaScript">
	$(document).ready(function() {
		$("#allsts").change(function() {
			var isChecked = $('.selsts').attr('checked') ? true : false;
			if (isChecked == false) {
				$(".selsts").attr('checked', true);
			} else {
				$(".selsts").attr('checked', false);
			}

		});

		$('#search').keyup(function() {
			searchTable($(this).val());
		});

		$("#example").tablesorter({
			// pass the headers argument and assing a object 
			headers : {
				// assign the secound column (we start counting zero) 
				0 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				// assign the third column (we start counting zero) 
				5 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				6 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				3 : {
					// disable it by setting the property sorter to false 
					sorter : false
				},
				4 : {
					// disable it by setting the property sorter to false 
					sorter : false
				}
			}
		});
	});

	function searchTable(inputVal) {
		var table = $('#example');
		table.find('tr').each(function(index, row) {
			var allCells = $(row).find('td');
			if (allCells.length > 0) {
				var found = false;
				allCells.each(function(index, td) {
					var regExp = new RegExp(inputVal, 'i');
					if (regExp.test($(td).text())) {
						found = true;
						return false;
					}
				});
				if (found == true)
					$(row).show();
				else
					$(row).hide();
			}
		});
	}
</script>

<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
#top{
	top: 0;
}
.scrollable { width:1100px; height:490px; overflow-y:auto; overflow-x:auto; clip-rect:(0px, 1100px, 490px, 0px); }


#right_icon a:LINK {
	color: white;
	text-decoration: none;
}

#right_icon a:VISITED {
	color: white;
	
}
#right_icon :HOVER {
	background-color: #CD2626;
}


</style>
</head>
<body>

<form action="updateDepartmentBatch?department_id=<s:property value="department_id"/>&value=updatedepbatch" method="post" enctype="multipart/form-data">
	<table>
	<tr>
	<td>
		<s:select list ="batch" listValue="batch_name" listKey="batch_id" name="batch_id" value="batch_name"></s:select>
	</td>
	<td><s:submit id="update" label="Submit"/></td>
	</tr>
	</table>
</form>
	<table><tr>
	<!--  
	<td  width="1060" id="top" valign="top">
		<a href="addNewDepartment" id="addrow"><font style="font-size: small;"><img alt="" src="images/plus.png">Add New Entry</font></a>
		&emsp;
			<a href="javascript:void(0);"
				onclick="PopupCenter('admin/UploadExcel.jsp','batch',300,300);"><font style="font-size: small;"><img alt="" src="images/upload.png">Upload
				</font></a></td>
				-->
				<td width="1200" align="right"><img alt="" src="images/search.png"><input type="text" id="search" size="50" />
		</td><td width="20"></td>
		</tr></table>
	<form id="form" action="deletebooks.action" method="post">
	<div class="scrollable">
	<table id="example" class="tablesorter" width="100%" style="border-color: gray; border-style: solid; border-width: thin;">
		<thead>
			<tr bgcolor="yellow">
			<th><input type="checkbox" id="allsts" /></th>
			<th>Batch Id</th>
			<th>Batch Name</th>
			<th>Description</th>
			<th>Students</th>
		<!--  	<th>EDIT</th>
			<th>DELETE</th>
			-->
			</tr>
		</thead>
		<tbody>
		
	<s:iterator value="batchlist">
		<tr>
		<td><input type="checkbox" class="selsts" value='<s:property value="batch_id" />' name="batch_id"/></td>
		<td><s:property value="batch_id"/></td>
		<td><s:property value="batch_name"/></td>
		<td><s:property value="description"/></td>
		<td><s:property value="student_count"/></td>
	<!-- 	<td><a href="editDepartmentDetails.action?department_id=<s:property value="department_id"/>&value=editdep">EDIT</a></td>
		<td><a href="deleteDepartmentDetails.action?department_id=<s:property value="department_id"/>&value=deletedepart">DELETE</a></td>
 -->
		</tr>
	</s:iterator>
			
</tbody>
</table>
</div>			
</form>


</body>
</html>